<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<html>
<head>
    <title>增加新书</title>
    <script src="jquery.min.js"></script>
</head>
<body>
<div>

    <form action="updatebook.do" method="post">
        <input type="hidden" name="bookId" value="${book.bookId}"/>
        <p>
            图书编号: <input type="text" id="bookCode" name="bookCode" value="${book.bookCode}"> *
            图书名称: <input type="text" id="bookName" name="bookName" value="${book.bookName}"> *
        </p>
        <p>
            图书类型:
            <select id="bookType" name="bookType">
                <c:forEach items="${types}" var="booktype">
                    <option value="${booktype.id}">${booktype.typeName}</option>
                </c:forEach>
            </select>
            作者: <input type="text" id="bookAuthor" name="bookAuthor" value="${book.bookAuthor}"> *
        </p>
        <p>
            出版社: <input type="text" id="publishPress" name="publishPress" value="${book.publishPress}"> *
            是否借阅:
            <select id="borrowed" name="borrowed">
                <option value="0">未借阅</option>
                <option value="1">已借阅</option>
            </select> *
        </p>
        <p>
            入库人: <input type="text" id="createdBy" name="createdBy" value="${book.createdBy}" readonly> *

            入库时间: <input type="text" id="creationTime" name="creationTime" value="${book.creationTime}"> *
        </p>
        <p>

            出版日期: <input type="text" id="ublishDate" name="ublishDate" value="${book.ublishDate}"> *
        </p>

        <p>
            <input type="submit" id="dbaocun" value="保存">

            <button type="button" id="fanhui">返回</button>
        </p>
    </form>
</div>

<script>
    $(function () {
        $("#bookType").val('${book.bookType}');
        $("#borrowed").val("${book.borrowed}");

        $("#fanhui").click(function () {
            history.back();
        });
    });
</script>

</body>
</html>